<template>
  <Modal v-model="visible" :title="title" :closable='false' @on-cancel='cancel'>
    <slot></slot>
    <div slot="footer">
      <div class="module-btn">
        <slot name="active">
          <Button type="primary" @click="cancel">取消</Button>
          <Button type="primary" @click="ok" :loading="loading">确认</Button>
        </slot>
      </div>
    </div>
  </Modal>
</template>

<script>
export default {
  name: "SPopupbox",
  props: {
    visible: {
      type: Boolean,
    },
    title: {
      type: String,
      default: "名称",
    },
  },
  data() {
    return {
      loading: false,
    };
  },

  mounted() {},

  methods: {
    cancel() {
      this.$emit("cancel", false);
    },
    ok() {},
  },
};
</script>

<style lang="scss" scoped>
.module-btn {
  display: flex;
  justify-content: center;
}
</style>